<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //原型对象prototype
        function Person(name, sex) {
            this.aname = name;
            this.asex = sex;
        }

        console.log(Person.prototype);

        //公共变量为静态变量，想要使用静态变量方式声明
        //静态变量也可以使用原型对象声明，但是无法通过构造函数调用了
        Person.prototype.aage = 13;
        var person = new Person('ArimaMisaki','fale');
        console.log(person.aage);

        //添加公共方法
        Person.prototype.run = function () {
            console.log("人会走路");
        }
        console.log(person.run());
    </script>
</head>
<body>
    
</body>
</html>